package ru.maksb.exchange.server;

import java.net.Socket;

import ru.maksb.exchange.exceptions.ExchangeException;
import ru.maksb.exchange.service.ExchangeWorker;

public class SocketHandler {
    
	public void handle(Socket socket, ExchangeWorker exchange) {
	    /*
	     * For each socket-connection start thread with ServerWorker, wich 
	     * will process given socket connection
	     */
	    try {
            new Thread(new ServerWorker(socket, exchange)).start();
        } catch (ExchangeException e) {
            //XXX rethrow or handle here?
            e.printStackTrace();
        }
	}
}
